package com.woniu.houtai.config;

import org.springframework.context.annotation.Configuration;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;


public class Converter {//时间格式转换
    public static String toDate(Date date) {
        return toDate(date, "yyyyMMdd");
    }
    public static String toDate(Date date, String fmt) {
        DateFormat format = new SimpleDateFormat(fmt);
        String str = format.format(date);
        return str;
    }
}
